// ml:run = $bin > input
#include <iostream>
#include <ctime>
#include <cstdlib>

int const maxn = 300;
bool vis[maxn][maxn];
int in[maxn];

int main()
{
	std::srand(std::time(0));
    int T = 1;
    std::cout << T << "\n";
	int n = 100, m = 1000, s = 10;
	std::cout << n << " " << m << " " << s << "\n";
    for (int i = 0; i < m; i++) {
        int u, v;
        int tn = 50;
        do {
            u = rand() % tn + 1;
            v = rand() % tn + 1;
            /* if (in[u] >= 30 || in[v] >= 30) continue; */
            if (u == v) continue;
            if (!vis[u][v]) {
                vis[u][v] = vis[v][u] = true;
                in[u]++;
                in[v]++;
                break;
            }
        } while (true);
        std::cout << u << " " << v << "\n";
    }
}

